/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.asu.cse360.config;

import edu.asu.cse360.annotation.TargetEntity;
import edu.asu.cse360.dao.GenericJpaDao;
import edu.asu.cse360.model.Chef;
import edu.asu.cse360.model.CustomerSession;
import edu.asu.cse360.model.Employee;
import edu.asu.cse360.model.ItemOrder;
import edu.asu.cse360.model.Manager;
import edu.asu.cse360.model.MenuItem;
import edu.asu.cse360.model.Order;
import edu.asu.cse360.model.Payment;
import edu.asu.cse360.model.PaymentConfirmation;
import edu.asu.cse360.model.Receipt;
import edu.asu.cse360.model.Restaurant;
import edu.asu.cse360.model.Table;
import edu.asu.cse360.model.WaitPerson;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class DaoConfig {

    @Bean
    @TargetEntity(MenuItem.class)
    public GenericJpaDao<MenuItem, Integer> menuItemDao(){
        return new GenericJpaDao<MenuItem, Integer>(MenuItem.class);
    }

    @Bean
    @TargetEntity(Table.class)
    public GenericJpaDao<Table, Integer> tableDao(){
        return new GenericJpaDao<Table, Integer>(Table.class);
    }

    @Bean
    @TargetEntity(Restaurant.class)
    public GenericJpaDao<Restaurant, Integer> restaurantDao(){
        return new GenericJpaDao<Restaurant, Integer>(Restaurant.class);
    }

    @Bean
    @TargetEntity(Chef.class)
    public GenericJpaDao<Chef, Integer> chefDao(){
        return new GenericJpaDao<Chef, Integer>(Chef.class);
    }

    @Bean
    @TargetEntity(Manager.class)
    public GenericJpaDao<Manager, Integer> managerDao(){
        return new GenericJpaDao<Manager, Integer>(Manager.class);
    }

    @Bean
    @TargetEntity(WaitPerson.class)
    public GenericJpaDao<WaitPerson, Integer> waitPersonDao(){
        return new GenericJpaDao<WaitPerson, Integer>(WaitPerson.class);
    }

    @Bean
    @TargetEntity(Employee.class)
    public GenericJpaDao<Employee, Integer> employeeDao(){
        return new GenericJpaDao<Employee, Integer>(Employee.class);
    }

    @Bean
    @TargetEntity(ItemOrder.class)
    public GenericJpaDao<ItemOrder, Integer> itemOrderDao(){
        return new GenericJpaDao<ItemOrder, Integer>(ItemOrder.class);
    }

    @Bean
    @TargetEntity(Receipt.class)
    public GenericJpaDao<Receipt, Integer> receiptDao(){
        return new GenericJpaDao<Receipt, Integer>(Receipt.class);
    }

    @Bean
    @TargetEntity(Payment.class)
    public GenericJpaDao<Payment, Integer> paymentDao(){
        return new GenericJpaDao<Payment, Integer>(Payment.class);
    }

    @Bean
    @TargetEntity(PaymentConfirmation.class)
    public GenericJpaDao<PaymentConfirmation, Integer> paymentConfirmationDao(){
        return new GenericJpaDao<PaymentConfirmation, Integer>(PaymentConfirmation.class);
    }

    @Bean
    @TargetEntity(Order.class)
    public GenericJpaDao<Order, Integer> orderDao(){
        return new GenericJpaDao<Order, Integer>(Order.class);
    }

    @Bean
    @TargetEntity(CustomerSession.class)
    public GenericJpaDao<CustomerSession, Integer> sessionDao(){
        return new GenericJpaDao<CustomerSession, Integer>(CustomerSession.class);
    }

}
